home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Pascal Super Library
/
Pascal Super Library (CW International)(1997).bin
/
STRINGS
/
PACKAGE6
/
READ_STR.DOC
< prev
next >
Wrap
Text File
|
1990-07-25
|
2KB
|
45 lines
-----------------------------------------------------------------------------
ReadlnString
-----------------------------------------------------------------------------
declaration: procedure ReadlnString ( var AString:
TypeString;
StringLength:
integer;
var LastKey:
TypeKey);
purpose: To read from the input a string of characters and to put in a
packed array. Length shall be = to the number of elements in
the array
preconditions: AString delcared. 0 <= StringLength <= MaxStringLength.
LastKey is declared.
postconditions: AString Filled with either an empty set if escape is the last
key pressed, or with the contents entered by the user, if
Return is the last key pressed
special cases: The user presses enter with out entering anything. The user
presses backspace while nothing is in the screen. The user
tries to add more characters than will be allowed.
example: var
AString:
TypeString;
LastKey:
TypeKey;
begin
.
.
.
write(output,'Enter your name: ');
ReadlnString(AString,34,LastKey);
.
.
.
end
-----------------------------------------------------------------------------